import { http } from '@/utils/request'

import type { IResCategory } from '@/types/category'

/**
 * @description 获取一级分类数据
 */
export const reqCategory1 = () => {
  return http<IResCategory[]>('/admin/product/getCategory1', 'GET')
}

/**
 * @description 获取二级分类数据
 */
export const reqCategory2 = (id: number) => {
  return http<IResCategory[]>(`/admin/product/getCategory2/${id}`, 'GET')
}

/**
 * @description 获取三级分类数据
 */
export const reqCategory3 = (id: number) => {
  return http<IResCategory[]>(`/admin/product/getCategory3/${id}`, 'GET')
}
